<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>外边距合并</title>
    <style>
        * {
            overflow: hidden;
            margin: 0;
            padding: 0;
        }
        .father {
            width: 400px;
            height: 400px;
            background: purple;
            margin-top: 50px;
            /*border-top: 1px solid transparent;*/
            /*padding: 1px;*/
        }
        .son {
            width: 200px;
            height: 200px;
            background: pink;
            margin-top: 100px;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son"></div>
    </div>
</body>
</html>